using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Reflection;

namespace Dragoon
{
    /// <summary>
    /// Shows a more friendly error message
    /// </summary>
    public partial class ExceptionBox : Form
    {

        static public void Show(Exception ex)
        {
            ExceptionBox box = new ExceptionBox(Assembly.GetCallingAssembly(),ex);
            box.ShowDialog();
        }

        private  ExceptionBox(Assembly a, Exception ex)
        {
            InitializeComponent();
            _ctlMessageText.Text = 
                string.Format("{0}\r\n{1}\r\n{2}", 
                    a.FullName, 
                    ex.Message,
                    ex.StackTrace);
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
    }
}